import java.io.IOException;
import java.io.ObjectOutputStream;
import java.util.Scanner;

public class ClientSend implements Runnable {

    private ObjectOutputStream oos;

    public ClientSend(ObjectOutputStream oos){
        this.oos = oos;
    }


    @Override
    public void run() {
        while (true){
            try {
                Scanner scanner = new Scanner(System.in);
                //获取客户端输入的信息
                String msg = scanner.nextLine();
                //发送信息到服务器
                oos.writeObject(msg);
                oos.flush();

            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
